<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <%@ include file="../common.jsp" %>
<script type="text/javascript">
	$(document).ready(function(){
	 setWorkFlowURL('<c:out value="${flowExecutionUrl}" />');
	 bindEventsForDocDtlsPage();
		/* searchLayout = $('#contentDiv').layout({
			north__size: 				200
			,west__closable: 			false
			,west__resizable:			false
			,west__spacing_open:		5
			,west__spacing_closed:		20
			,north__paneSelector: 		'#serchCriteriaDiv'
			,center__paneSelector: 		'#searchResult'

		});
		appMainLayout.resizeAll(); */
		//appInnerLayout.resizeAll();  
	    
	});
</script>

<div align="center">
	<table class="bodyTable">
		<tr align="right" style="width: 100%;" >
			<td >
				<table class="filtersTable zeroBorder" style="width: 100%;">
					<tr class="tableChildHeaderColor" align="left" style="width: 100%;">
						<td>
							<table style="width: 100%;" class="zeroBorder">
								<tr>
									<td style="width: 80%;">
										<table class="zeroBorder">
											<tr>
												<td class="spacingColumnWidthLess"></td>
												<td align="left">
													<img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-11.png">
												</td>
												<td class="spacingColumnWidthLess"></td>
												<td style="vertical-align: middle;"><span class="tableMainHeaderFont"> SEARCH FOR DOCUMENTS </span></td>
											</tr>
										</table>
									</td>
									<td align="right" style="width: 20%;" >
										<table class="zeroBorder">
											<tr id="toggleDiv" class="displayNone" style="background-color: #000000; border-color: #000000; border-style: solid;">
												<td class="togglerFont errorMessage">
													MODIFY SEARCH
												</td>
												<td>
													<img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-43.png" onclick="javascript:showDiv('#serchCriteriaDiv','#toggleDiv')">
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr class="formSpacingRow formBlockColor"><td></td></tr>
					<tr align="center">
						<td>
							<div id="serchCriteriaDiv" class="formBlockColor">
								<form:form commandName="searchCriteria" id="searchCriteria">
								<input type="hidden" value="0" name="docId" />
								<table style="width: 100%;">
									<tr>
										<td class="formLabel">Name</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField"><form:input path="documentName"/></td>
										<td class="spacingColumnWidthMedium"></td>
										<td class="formLabel">Sub-Category</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField"><form:select path="docSubCategoryId" name="docSubCategID" id="docSubCategID"></form:select></td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td class="formLabel">Document Code</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField"><form:input path="docCode" /></td>
										<td class="spacingColumnWidthMedium"></td>
										<td class="formLabel">Business Unit</td>	<!-- changed from location to business unit on 25-02-2012 as told by shubh -->
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<form:select path="location" id="locselect" name="location" onchange="loadDepttForBU(this.id,'department')">
												<form:option value="0">All</form:option>
												<c:forEach items="${locationList}" var="item">
													<form:option value="${item.key}">${item.value}</form:option>
												</c:forEach>
											</form:select>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td class="formLabel">Type</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<form:select path="docTypeId" name="docTypeId" id="docID">
												<form:option value="0">All</form:option>
													<c:forEach items="${docTypeMap}" var="item">
														<form:option value="${item.key}">${item.value}</form:option>
													</c:forEach>
												</form:select>
										</td>
										<td class="spacingColumnWidthMedium"></td>
										<td class="formLabel">Department</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<form:select path="department" id="department" name="department" >
												<form:option value="0">All</form:option>
											</form:select>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td class="formLabel">Category</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField"><form:select path="docCategoryId" name="docCategID" id="docCategID"></form:select></td>
										<td class="spacingColumnWidthMedium"></td>
										<td class="formLabel"> Authorized Signatory Id </td>
										<td class="spacingColumnWidthLess"></td>
										<td class="formField" align="left">
											<form:input path="authSignatoryId" readonly="true" id="authSignId"/>
											<img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-30.png" onclick="showUserLookUpDialogForWF('ROLE_AUTHSIGN');" ></td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td class="formLabel">Issuing Authority</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField"><form:input path="docIssuingAuthority" /></td>
										<td class="spacingColumnWidthMedium"></td>
										<td class="formLabel">Agreement Entered with</td>
										<td class="spacingColumnWidthLess"></td>
										<td class="formField" align="left">
											<form:input path="docEnteredWith"/>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td class="formLabel"> Owner Id </td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<form:input path="ownerId" readonly="true" id="documentOwner"/>
											<img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-30.png" onclick="showUserLookUpDialog();" ></td>
										<td class="spacingColumnWidthLess"></td>
										<td class="formLabel"> Status </td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<form:select path="documentStatus">
												<form:option value="Active">Active</form:option>
												<sec:authorize access="hasAnyRole('ROLE_CC','ROLE_CCC','ROLE_OWNER')">
												<form:option value="Deactive">De-Active</form:option>
												</sec:authorize>
											</form:select>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td class="formLabel">
											Custodian Name
										</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<form:input path="custodianId"/>
										</td>
										<td class="spacingColumnWidthLess"></td>
										<td class="formLabel">
											<sec:authorize access="hasAnyRole('ROLE_CC','ROLE_CCC','ROLE_OWNER','ROLE_SO')">
											Company
											</sec:authorize>
										</td>
										<td class="spacingColumnWidthLess"></td>
										<td align="left" class="formField">
											<sec:authorize access="hasAnyRole('ROLE_CC','ROLE_CCC','ROLE_OWNER','ROLE_SO')">
												<form:select path="companyId">
													<form:option value="0">All</form:option>
													<c:forEach items="${companyMap}" var="company"> 
													<form:option value="${company.key}">${company.value}</form:option>
													</c:forEach>
												</form:select> 
											</sec:authorize>
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr class="formSpacingRow"><td></td> </tr>
									<tr>
										<td colspan="6"> </td>
										<td>
											<input type="reset" class="resetButton" value="RESET">
											<input class="formButton ui-corner-all" type="button" value="SEARCH" onclick="searchDocuments();">
										</td>
										<td class="spacingColumnWidthLess"></td>
									</tr>
									<tr>
										<td colspan="6"></td>
										<td align="right">
											<img alt="" src="./customTheme/Icons/BlueLotus_DMS_icons-43.png" class="displayBlock" onclick="javascript:hideDiv('#serchCriteriaDiv','#toggleDiv')">
										</td> 
									</tr>
								</table>
								</form:form>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr class="formSpacingRow"><td></td> </tr>
		<tr>
			<td>
				<div id="searchResult"></div>
			</td>
		</tr>
	</table>
</div>


